package com.hzy.ioc.impl;

import com.hzy.ioc.Ink;

import java.awt.*;

/**
 * @Package: com.hzy.ioc.impl
 * @ClassName: GreyInk
 * @Author: 862982795
 * @CreateTime: 2021/07/03 9:23
 * @Description:灰色墨盒
 */
public class GreyInk implements Ink {
    /**
     * 打印灰色文字
     *
     * @param red
     * @param green
     * @param blue
     * @return
     */
    @Override
    public String getColor(int red, int green, int blue) {
        int c = (red + green + blue) / 3;
        Color color=new Color(c,c,c);
        return "#"+Integer.toHexString(color.getRGB()).substring(2);
    }
}
